<?php	
header('Content-type:text/html;charset=utf8');
date_default_timezone_set("PRC");
//载入smarty
include "./libs/Smarty.class.php";
//载入模型类
include "./model.class.php";
//实例化smarty
$smarty = new Smarty();
//设置模板模板目录
$smarty->template_dir = "View";
//编译目录
$smarty->compile_dir = "temp/compile";
//开始定界符
$smarty->left_delimiter = "{";
//结束定界符
$smarty->right_delimiter = "}";

$arr = [
	"name"=>"小明",
	"info"=>[
		"url"=>"www.houdunwang.com",
	],
];
//分配到模板页面
$smarty->assign("data",$arr);

//常量是不需要进行分配的
define("APP","我是常量内容");

$letter = "qwertyuiopdfghj";
$smarty->assign("letter",$letter);

$data = [
	"name"=>"小红",
	"age"=>18,
];
$smarty->assign("data",$data);

$model = new Model();
$stuData = $model->query("select * from stu");
$smarty->assign("stuData",$stuData);

//载入模板
$smarty->display("index.html");











































































